import request from "../request";

// 一级科室数据接口
export interface OneDepartment {
  deptId: string;
  deptNo?: string;
  deptName: string;
  description: string;
}

// 子科室数据接口
export interface ChildDepartment {
  deptId: string;
  deptNo: string;
  deptName: string;
  description: string;
  parentId: string;
}

// 获取一级科室列表
export function getOneDeptList() {
  return request<OneDepartment[]>({
    url: "/system/dept/getOneDeptList",
    method: "GET",
  });
}

// 获取子科室列表
export function getChildDeptList(parentId: string) {
  return request<ChildDepartment[]>({
    url: `/system/dept/getChildDeptList/${parentId}`,
    method: "GET",
  });
}

//获取科室详情getDeptDetailByDeptIds
export function getDeptDetailByDeptIds(deptIds: string[]) {
  return request<OneDepartment[]>({
    url: `/system/dept/getDeptDetailByDeptIds?deptIds=${deptIds.join(",")}`,
    method: "GET",
  });
}
